* {
  box-sizing: border-box;
  outline: none;
}

html {
  font-size: 13px;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.2em;
  background: #f1f1f1;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #999;
}

p {
  line-height: 1.5em;
}

// colors list/map定义 数组定义
$colors: (
  "primary": #db9e3f,
  "white": #fff,// 命名与颜色有冲突,用""包括
  "light": #f9f9f9,
  "grey": #999,
  "grey-1": #666,
  "dark": #222,
  "dark-1": #343440,
  "black": #000,
);

@each $colorKey, $color in $colors {
  .text-#{$colorKey} {
    color: $color;
  }

  .bg-#{$colorKey} {
    background-color: $color;
  }
}

// text align集合定义
// @each:循环
// $var: 变量
// (val): 集合
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var;
  }
}

// font size
$base-font-size: 1rem;
$font-sizes: (
        xxs:0.615, //8px
        xs: 0.769, //10px
        sm: 0.923, //12px
        md: 1, //13px
        lg: 1.076, //14px
        xl: 1.231, //16px
);

@each $sizeKey, $size in $font-sizes{
  .fs-#{$sizeKey} {
    font-size: $size * $base-font-size;
  }
}

// width, height
.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

// flex
.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

// 主轴对齐方式
$flex-jc: (
  start: flex-start,
  end: flex-end,
  center: flex-center,
  between: flex-between,
  around: flex-around
);

@each $key, $value in $flex-jc {
  .jc-#{$key} {
    justify-content: $value;
  }
}


// 交叉轴对齐方式
$flex-ai: (
  start: flex-start,
  end: flex-end,
  center: flex-center,
  stretch: stretch
);

@each $key, $value in $flex-ai {
  .ai-#{$key} {
    align-items: $value;
  }
}

.flex-1 {
  flex: 1;
}
.flex-grow-1 {
  flex-grow: 1;
}

// spacing
// 0-5:
// .mt-1 => margin-top
$spacing-types: (
  m: margin,
  p: padding
);
$spacing-directions: (
  t: top,
  r: right,
  b: bottom,
  l: left
);
$spacing-base-size: 1rem;
$spacing-sizes: (
  0: 0,
  1: 0.25,
  2: 0.5,
  4: 1.5,
  5: 3
);// 定义对应倍数

@each $typeKey, $type in $spacing-types {
  // .m-1
  @each $sizeKey, $size in $spacing-sizes {
    .#{$typeKey}-#{$sizeKey} {
      #{$type}: $size * $spacing-base-size;
    }
  }
  // .mx-1 , .my-1
  @each $sizeKey, $size in $spacing-sizes {
    .#{$typeKey}x-#{$sizeKey} {
      #{$type}-left: $size * $spacing-base-size;
      #{$type}-right: $size * $spacing-base-size;
    }
    .#{$typeKey}y-#{$sizeKey} {
      #{$type}-top: $size * $spacing-base-size;
      #{$type}-bottom: $size * $spacing-base-size;
    }
  }
  // .mt-1
  // .mt-1
  @each $directionKey, $direction in $spacing-directions {
    @each $sizeKey, $size in $spacing-sizes {
      .#{$typeKey}#{$directionKey}-#{$sizeKey} {
        #{$type}-#{$direction}: $size * $spacing-base-size;
      }
    }
  }
}

// btn
.btn {
  border:none;
  border-radius: 0.1538rem;
  font-size: map-get($font-sizes, 'sm') * $base-font-size;
  padding: 0.2rem 0.6rem;
}

// nav
.nav{
  .nav-item{
    border-bottom: 3px solid transparent;
    padding-bottom: 0.2rem;
    //&: 上一层本身
    &.active {
      border-bottom: 3px solid #fff;
    }
  }
}